package com.example.testdemo.rxjava_test;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.text.style.UpdateLayout;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.example.testdemo.R;

import org.greenrobot.eventbus.EventBus;

public class EventBusC_Activity extends AppCompatActivity {
    public static final String TAG = "EventBusB_Activity";
    private Button btnSend;
    private TextView textView;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_rxjava_test_a_view);
        btnSend = findViewById(R.id.button);
        textView = findViewById(R.id.textView2);


        btnSend.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                UpDateUiEvent upDateUiEvent =  new UpDateUiEvent();
                upDateUiEvent.text = "从C页面发送过来得数据";
                //发送事件
                EventBus.getDefault().post(upDateUiEvent);
            }
        });
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
}
